<?php
require(dirname(__FILE__)."/includes/init.php");
if(isset($_SESSION['user_name'])){
$perPageNum = $GLOBALS['pageSize'];
$pageNum = isset($_REQUEST['pg'])?$_REQUEST['pg']:1;
$email = isset($_REQUEST['specify'])?$_REQUEST['specify']:NULL;
$recordSet = isset($_REQUEST['recordSet'])?$_REQUEST['recordSet']:NULL;

$id = NULL;
$listArr = checkClickRate($id,$pageNum,$email,$recordSet);

?><title>点击率</title>
<table width="1263" height="147" border="0" bgcolor="#0066FF">
  <tr bgcolor="#FFFFFF">
<form action="clickRate.php" name="openRate" method="get">  
    <td>查询</td>
    <td colspan="3"><input name="specify" type="text" id="specify" size="35" />
        <input type="submit" value="Get" />     </td></form>
<form action="clickRate.php" name="openRate" method="get">		
    <td>查询记录集</td>
    <td colspan="3"><label>
      <input name="recordSet" type="text" id="recordSet" size="35" />
      <input type="submit" value="Get" />
    </label></td>
</form>	
  </tr>

  <tr bgcolor="#FFFFFF">
    <td width="90">id</td>
    <td width="227">address</td>
    <td width="113">Language</td>
    <td width="168">Country</td>
    <td width="253">时间<span style=" background:#990000; color:#FFFFFF"><?php echo date("Y-m-d H:i:s",time());?></span></td>
    <td width="137">打开次数/URL</td>
    <td width="48">分组</td>
    <td width="193">查看所有记录</td>
  </tr>
 <?php foreach($listArr as $key=>$value){?>   
  <tr bgcolor="#FFFFFF">
    <td><?php echo $value['id'];?></td>
    <td><?php echo $value['address'];?></td>
    <td><?php echo $value['brownserLanguage'];?></td>
    <td><?php echo $value['country'].":".$value['province'];?></td>
    <td><?php echo date("Y-m-d H:i:s",$value['timeStamps']);?></td>
    <td><?php if(!empty($email)){echo $value['url'];}else{echo $value['num'];}?></td>
    <td><?php echo $value['type'];?></td>
    <td><a href="clickRate.php?specify=<?php echo $value['address'];?>" target="_blank">查看</a></td>
  </tr>
 <?php }?> 
  <tr bgcolor="#FFFFFF">
    <td colspan="8"><?php $totalNum = getClickRateNum($email,$recordSet);
	$page = new Pager($totalNum[0],$perPageNum,$style="page");
	?></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td colspan="3">&nbsp;</td>
  </tr>
</table>
<?php
}else{
 echo "hello";
}
?>